/*
 * @Description: 
 * @Author: charles
 * @Date: 1985-10-26 16:15:00
 * @LastEditors: charles
 * @LastEditTime: 2021-11-15 12:18:41
 */
import axios from 'axios'
export default {

  namespace: 'article',

  state: {
    list:[]
  },

  subscriptions: {
    setup({ dispatch, history }) {  // eslint-disable-line
    },
  },

  effects: {
    *fetch({ payload }, { call, put }) {  
      let url = "http://121.199.29.84:8002/index/pageQueryArticles";
      //let resp =yield axios.get(url,{params});
      let resp = yield call(axios.get,url,{params:payload})
      // 如何将resp更新到状态
      yield put({type:"refreshArticle",payload:resp.data.data})
    },
  },

  reducers: {
    refreshArticle(state, action) {
      return { ...state, ...action.payload };
    },
  },

};
